package com.wondersgroup.yly.client;

import com.alibaba.dubbo.config.annotation.Service;
import com.mseap.dtx.api.annotation.ATxSupport;
import com.mseap.framework.exception.BusinessException;
import com.wondersgroup.yly.api.DemoApi;
import com.wondersgroup.yly.dto.DemoDTO;
import com.wondersgroup.yly.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @program: yly-demo
 * @description:
 * @author: Zhangxiao
 * @create: 2019-10-08 13:09
 **/
@Service
@ATxSupport("可靠消息提供者：DemoApi")
public class DemoApiImpl implements DemoApi {

    @Autowired
    private DemoService demoService;


    @Override
    public Long insert(DemoDTO demoDTO) throws BusinessException {
        return demoService.insert(demoDTO);
    }

    @Override
    public Long insertTry(DemoDTO demoDTO) {
        return demoService.insertTry(demoDTO);
    }

    @Override
    public void insertConfirm(DemoDTO demoDTO, Long id) {
        demoService.insertConfirm(demoDTO, id);
    }

    @Override
    public void insertCancel(DemoDTO demoDTO, Long id) {
        demoService.insertCancel(demoDTO, id);
    }

    @Override
    public void updateByPrimaryKey(DemoDTO demoDTO) throws BusinessException {
        demoService.updateByPrimaryKey(demoDTO);
    }
}
